package ${file.packageName};

import com.ezbuy.common.request.GrpcMapper;
import ${file.grpcPackageName}.${file.name};

public class ${name}Mapper implements GrpcMapper<${file.name}.${name}, ${name}> {

    @Override
    public ${file.name}.${name} toGrpc(${name} entity) {
        switch (entity) {
            <#list values as value>
            case ${value}:
                return ${file.name}.${name}.${value};
            </#list>
            default:
        }
        return ${file.name}.${name}.values()[0];
    }

    @Override
    public ${name} fromGrpc(${file.name}.${name} grpc) {
        switch (grpc) {
            <#list values as value>
            case ${value}:
                return ${name}.${value};
            </#list>
            default:
        }
        return ${name}.values()[0];
    }
}